<template>
  <el-pagination
    :current-page.sync="pageData.pagenum"
    :page-sizes="pageSizes"
    :page-size.sync="pageData.pagesize"
    layout="total, sizes, prev, pager, next, jumper"
    :total="total"
    @size-change="$emit('page-change')"
    @current-change="$emit('page-change')"
  />
</template>

<script>
export default {
  props: {
    pageData: {
      type: Object,
      required: true
    },
    total: {
      type: Number,
      required: true
    },
    pageSizes: {
      type: Array,
      default: () => [2, 4, 8, 10]
    }
  },
  data() {
    return {

    }
  },
  created() {
  },

  methods: {
    handleSizeChange(val) {
      console.log(`每页 ${val} 条`)
    },
    handleCurrentChange(val) {
      console.log(`当前页: ${val}`)
    }
  }
}
</script>

<style scoped lang='less'>

</style>
